﻿using UnityEngine;
using System.Collections;

public class ScaleTransformation : Transformation
{

    public Vector3 scale = new Vector3(1, 1, 1);

    public override Matrix4x4 Matrix
    {
        get
        {
            Matrix4x4 mat = new Matrix4x4();
            mat.SetRow(0, new Vector4(scale.x, 0, 0, 0));
            mat.SetRow(1, new Vector4(0, scale.y, 0, 0));
            mat.SetRow(2, new Vector4(0, 0, scale.z, 0));
            mat.SetRow(3, new Vector4(0, 0, 0, 1));
            return mat;
        }
    }

    public override Vector3 Apply(Vector3 point)
    {
        point.x *= scale.x;
        point.y *= scale.y;
        point.z *= scale.z;
        return point;
    }
}
